from .base import Base
from .common import CommonMixin
from sqlalchemy import String, Integer, Column
from sqlalchemy.orm import relationship

""" 角色表 """


class Role(Base, CommonMixin):
    __tablename__ = 'role'

    id = Column(Integer, primary_key=True, comment='主键ID', autoincrement=True)
    name = Column(String(32), unique=True, comment="用户名")
    code = Column(String(32), comment="角色code", unique=True)
    description = Column(String(60), comment="角色描述", nullable=True)
    updata_by_user_id = Column(String(60), comment="操作人", nullable=True)
    user_role = relationship("UserRole", back_populates="role")
